package logic.collegeQuery_logic;

import java.util.List;

import javaRMI.RMIClient;
import logicsv.collegeQuery_logicsv.CollegeQueryLogicsv;
import po.CollegeConsularPO;
import po.CollegeStudentListPO;
import po.CollegeTeacherListPO;
import po.StudentPO;
import po.TeacherPO;
import resultmessage.CollegeQueryRM;
import vo.CollegeListVO;
import vo.CourseVO;

public class CollegeQueryLogicsvController implements CollegeQueryLogicsv {
	private CollegeQuery collegeQuery;
	private CollegeConsularQuerysv collegeConsularQuery;
	private MemberQuerysv memberQuery;
	private CourseQuerysv courseQuery;
	
	public CollegeQueryLogicsvController(RMIClient rmi){
		collegeQuery = new CollegeQuery(rmi);
		collegeConsularQuery = new CollegeConsularQuery(rmi);
		memberQuery = new MemberQuery(rmi);
		courseQuery = new CourseQuery(rmi);
	}
	
	@Override
	public CollegeListVO getCollegeList() {
		CollegeListVO collegeListVO = collegeQuery.getCollegeList();
		return collegeListVO;
	}

	@Override
	public CollegeQueryRM addCourse(String collegeID, String courseID,String name) {
		CollegeQueryRM resultMessage = courseQuery.addCourse(collegeID, courseID,name);
		return resultMessage;
	}

	@Override
	public CollegeQueryRM deleteCourse(String collegeID, String courseID) {
		CollegeQueryRM resultMessage = courseQuery.deleteCourse(collegeID, courseID);
		return resultMessage;
	}


	@Override
	public CollegeQueryRM addCollegeConsular(String collegeID,
			CollegeConsularPO consular) {
		return collegeConsularQuery.addCollegeConsular(collegeID, consular);
	}

	@Override
	public CollegeQueryRM deleteCollegeConsular(String collegeID,String consularID) {
		CollegeQueryRM resultMessage = collegeConsularQuery.deleteCollegeConsular(collegeID, consularID);
		return resultMessage;
	}

	@Override
	public CollegeStudentListPO getCollegeSudents(String collegeID) {
		return memberQuery.getCollegeSudents(collegeID);
	}

	@Override
	public CollegeTeacherListPO getCollegeTeachers(String collegeID) {
		return memberQuery.getCollegeTeachers(collegeID);
	}

	@Deprecated
	@Override
	public CollegeQueryRM addStudent(String collegeID, StudentPO student) {
		return memberQuery.addStudent(collegeID, student);
	}
	@Deprecated
	@Override
	public CollegeQueryRM deleteStudent(String collegeID, String studentID) {
		return memberQuery.deleteStudent(collegeID, studentID);
	}
	@Deprecated
	@Override
	public CollegeQueryRM addTeacher(String collegeID, TeacherPO teacher) {
		return memberQuery.addTeacher(collegeID, teacher);
	}
	@Deprecated
	@Override
	public CollegeQueryRM deleteTeacher(String collegeID, String teacherID) {
		return memberQuery.deleteTeacher(collegeID, teacherID);
	}

	@Override
	public List<CourseVO> getCouOfCollege(String collegeID) {
		return courseQuery.getCouOfCollege(collegeID);
	}

	@Override
	public List<TeacherPO> getCollegeTeacherPOList(String collegeID) {
		return collegeQuery.getCollegeTeacherPOList(collegeID);
	}

	@Override
	public List<StudentPO> getCollegeStudentPOList(String collegeID) {
		return collegeQuery.getCollegeStudentPOList(collegeID);
	}
}
